IdeaBlade.Linq Assembly > IdeaBlade.Linq Namespace > PredicateBuilder Class > And Method : And(IPredicateDescription[]) Method |
'Declaration
Public Overloads Shared Function And( _ ByVal ParamArray predicateDescriptions() As IPredicateDescription _ ) As CompositePredicateDescription
'Usage
Dim predicateDescriptions() As IPredicateDescription Dim value As CompositePredicateDescription value = PredicateBuilder.And(predicateDescriptions)
public static CompositePredicateDescription And( params IPredicateDescription[] predicateDescriptions )
public void AndQuery() { var mgr = new DomainModelEntityManager(); var expr1 = new PredicateDescription(typeof(Customer), "Country", FilterOperator.IsEqualTo, "Mexico"); var expr2 = new PredicateDescription(typeof(Customer), "CompanyName", FilterOperator.StartsWith, "A"); // Where companyname starts with A and country = mexico var finalcrit = PredicateBuilder.And(expr1, expr2); var query = mgr.Customers.Where(finalcrit); var list = query.ToList(); }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2